package com.huabo.system.service.impl;

import com.huabo.system.config.DateBaseConfig;
import com.huabo.system.mysql.entity.TblIndicatorthresholdMySql;
import com.huabo.system.mysql.mapper.TblIndicatorthresholdMySqlMapper;
import com.huabo.system.oracle.entity.TblIndicatorthreshold;
import com.huabo.system.oracle.mapper.TblIndicatorthresholdMapper;
import com.huabo.system.service.TblIndicatorthresholdService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class TblIndicatorthresholdServiceImpl implements TblIndicatorthresholdService {

    @Resource
    private TblIndicatorthresholdMapper tblIndicatorthresholdMapper;
    @Resource
    private TblIndicatorthresholdMySqlMapper tblIndicatorthresholdMySqlMapper;

    @Override
    public List<TblIndicatorthreshold> findByIndicatorId(String thresholdid) {
        if (DateBaseConfig.DATABASETYPE.equals("Oracle")) {
            return tblIndicatorthresholdMapper.findByIndicatorId(thresholdid);
        } else {
            return tblIndicatorthresholdMySqlMapper.findByIndicatorId(thresholdid);
        }
    }
}
